package be.donovan.gui;

import java.awt.BorderLayout;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Map;

import javax.swing.JTextField;

import be.donovan.gui.helper.components.MVCPanel;
import be.donovan.model.PersonInfo;

public class PersonScreen extends MVCPanel {

	
	private Map<Field, JTextField> mappings=new HashMap<Field, JTextField>();
	@Override
	
	public void afterPropertiesSet() throws Exception {
		setLayout(new BorderLayout());
		mappings = addGenericInputPanel(this,PersonInfo.class, "id");
		super.afterPropertiesSet();
	}
	public Map<Field, JTextField> getMappings() {
		return mappings;
	}
	public void mapToObject(PersonInfo personInfo) {
		mapToObject(personInfo, mappings);
	}
	/**
	* This method should return an instance of this class which does 
	* NOT initialize it's GUI elements. This method is ONLY required by
	* Jigloo if the superclass of this class is abstract or non-public. It 
	* is not needed in any other situation.
	 */
	public static Object getGUIBuilderInstance() {
		return new PersonScreen(Boolean.FALSE);
	}
	
	/**
	 * This constructor is used by the getGUIBuilderInstance method to
	 * provide an instance of this class which has not had it's GUI elements
	 * initialized (ie, initGUI is not called in this constructor).
	 */
	public PersonScreen(Boolean initGUI) {
		super();
	}
	public PersonScreen(){
		
	}
	

}
